{% extends 'base.htm' %}
{% from 'macros.htm' import name_fmt %}
{% set title = 'Leaderboard' %}

{% macro leader_fmt(leader) -%}
    {% set user = leader.user %}
    {% set scores = leader.scores %}
    <img src="{{ user.photo.prefix|e ~ '36x36' ~ user.photo.suffix|e }}" class="usericon, righticon" alt=""><b>{{ leader.rank|e }}: 
	{{ name_fmt(user) }}</b><br>
    Recent: {{ scores.recent|e }}<br>
    Max: {{ scores.max|e }}<br>
    Checkins: {{ scores.checkinsCount|e }}<br style="clear:both">
{%- endmacro %}

{% block body %}
<ul class="vlist">
    {% for leader in leaders %}
	<li>{{ leader_fmt(leader) }}</li>
    {% else %}
	<p>Empty leaderboard?</p>
    {% endfor %}
</ul>
{% endblock %}

{# vim:set ft=htmldjango tw=0: #}
